home *** CD-ROM | disk | FTP | other *** search
- property bugx, bugy, bodychan, bodylist, lipchan, bugbody, buglips, bugsayit, bugsound, bugtempo, hypno, bugtext, mouseout, fluttercount
-
- on birth me, lchan, lipset
- set bugx to the locH of sprite lchan
- set bugy to the locV of sprite lchan
- set lipchan to lchan
- puppetSprite(lchan, 1)
- set buglips to lipset
- set fluttercount to 1
- set mouseout to 1
- return me
- end
-
- on sayit me
- global variations, fluttercount
- grabbuggy(me)
- if the number of cast bugsound < 1 then
- exit
- end if
- set soundtime to the size of cast bugsound / 183.0
- puppetSound(bugsound)
- set flutterinc to 64.0 / soundtime
- updateStage()
- set stime to the timer
- repeat while the timer < (soundtime + stime + 10)
- set dtime to the timer - stime
- set fluttercount to fluttercount + 1
- if fluttercount > 64 then
- set fluttercount to 1
- end if
- set the locH of sprite lipchan to bugx + getAt(variations, fluttercount)
- set the locV of sprite lipchan to bugy + getAt(variations, fluttercount + 16)
- if dtime < (soundtime - 10) then
- set the castNum of sprite lipchan to getAt(buglips, random(3) + 3)
- else
- set the castNum of sprite lipchan to getAt(buglips, 1)
- end if
- updateStage()
- mydelay(5)
- if the mouseDown and (mouseout = 1) then
- exit repeat
- end if
- end repeat
- set the castNum of sprite lipchan to getAt(buglips, 1)
- releasebuggy(me)
- end
-
- on flap me
- grabbuggy(me)
- repeat with ddd = 1 to 3
- set the castNum of sprite lipchan to getAt(buglips, ddd)
- updateStage()
- mydelay(10)
- end repeat
- repeat with ddd = 2 down to 1
- set the castNum of sprite lipchan to getAt(buglips, ddd)
- updateStage()
- mydelay(10)
- end repeat
- releasebuggy(me)
- end
-
- on flapto me, xloc, yloc, dtime, vary
- global variations
- set dx to (xloc - bugx) / (dtime * 1.0)
- set dy to (yloc - bugy) / (dtime * 1.0)
- set ptime to the timer
- set animcount to 1
- set animinc to 0.10000000000000001
- set flutterinc to 64.0 / dtime
- repeat while (the timer - ptime) < dtime
- set stime to the timer - ptime
- set fluttercount to 1 + integer(flutterinc * stime)
- set the locH of sprite lipchan to bugx + (dx * stime) + (getAt(variations, fluttercount) * vary)
- set the locV of sprite lipchan to bugy + (dy * stime) + (getAt(variations, fluttercount + 16) * vary)
- set animcount to animcount + animinc
- if (animcount > 4) or (animcount < 1) then
- set animinc to -animinc
- set animcount to animcount + animinc
- end if
- if (the timer - ptime) < (dtime - 20) then
- set the castNum of sprite lipchan to getAt(buglips, integer(animcount))
- else
- set the castNum of sprite lipchan to getAt(buglips, 1)
- end if
- updateStage()
- end repeat
- set bugx to the locH of sprite lipchan
- set bugy to the locV of sprite lipchan
- end
-
- on releasebuggy me
- puppetSprite(lipchan, 0)
- set hypno to 0
- end
-
- on grabbuggy me
- puppetSprite(lipchan, 1)
- set the castNum of sprite lipchan to getAt(buglips, 1)
- set hypno to 1
- end
-